package com.embhealth.dao;

import com.embhealth.pojo.Role;
import com.embhealth.pojo.User;
import com.github.pagehelper.Page;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;
import java.util.Set;

public interface RoleDao {
    public List<Map<String,Object>> findAllRole4AddUser();
    public Set<Role>  findByUserId(Integer userId);
    public Integer findRidByUsername(String username);
    public Integer findUserByRoleId(Integer id);
    public Page<Role> findPage(String queryString);
    public void addRole(Role role);
    public void addMenu4Role(@Param("menu_id")Integer mid,@Param("role_id")Integer rid);
    public void addPermission4Role(@Param("permission_id")Integer pid,@Param("role_id")Integer rid);
    public Role findById(Integer id);
    public Integer[] findPermissionsByRoleId(Integer id);
    public Integer[] findUrlsByRoleId(Integer id);
    public void edit(Role role);
    public void deletePermissionByRoleId(Integer rid);
    public void deleteMenuByRoleId(Integer rid);
    public void deleteRole(Integer id);
}
